#pragma once

#include <QtGui>

class TextButton : public QAbstractButton {

	Q_OBJECT

public:
	TextButton(QString id = "", 
		QString text = "",
		bool isDefault = true,
		QString fileName = "", 
		QString toolTip = "",
		int width = -1,
		int height = -1);
	void unSelect();
	QString m_Text;
	QString m_ID;
	int m_Width;
	int m_Height;

	void setFontSize(int fontSize);
	void setFontColor(QColor normalColor, QColor activeColor);
signals:
	void moveStarted();
	void moveWindow(QPoint location);
	void moveFinished();
	void ButtonClick(QString id);

private:
	bool isUnder;
	bool isSelect;
	QPixmap pixMap;
	QPixmap m_pixMapL;
	QPixmap m_pixMapR;
	QPixmap m_pixMapC;
	bool m_IsDefault;
	QPoint pos0,last;bool moving;	
	int m_FontSize;

	virtual bool event(QEvent *e);
	virtual void paintEvent(QPaintEvent *e);
	virtual void mousePressEvent(QMouseEvent *e);
	virtual void mouseReleaseEvent(QMouseEvent *e);
	virtual void mouseMoveEvent(QMouseEvent *e);
	QColor m_FontNormalColor;
	QColor m_FontActiveColor;

private slots:
	void click();
};